\begin{algorithm}
\caption{Tree2Path($T$, $H$)}
\label{alg:tree2path}
\begin{algorithmic}[1]
\STATE $H \leftarrow \{T\}$
%\REQUIRE{$T$ is the root of the tree cover}
%\REQUIRE{$H$ is a set}
\WHILE{$H \neq \emptyset$} 
    \STATE extract one vertex from $H$ to $T$
    \STATE $P \leftarrow \emptyset$
    \WHILE{$T\neq \empty$}
        \STATE append $T$ to path $P$; 
        \STATE extract one child of $T$ and assign to $T^\prime$
        \STATE $H \leftarrow H \cup T.children \backslash \{T^\prime\}$
        \STATE $T \leftarrow T^\prime$ 
    \ENDWHILE 
    \STATE ${\mathcal P} \leftarrow {\mathcal P} \cup \{P\}$
\ENDWHILE
\RETURN ${\mathcal P}$
\end{algorithmic}
\end{algorithm}